<%@ page import="org.xilin.Family"%>
<%@ page import="org.xilin.Student"%>
<%@ page import="org.xilin.Semester"%>

<div class="bar">
  <span class="left">Class Registration</span>
  <span class="right semester">
    <b>Semester: </b><x:semesterSelection semesterId="${session.activeSemester?.id}"/>
  </span>
</div>
<div>
  <table class="tablesorter">
     <thead>
    <tr>
      <th>Student</th><th>Course</th><th>Start Time</th><th>End Time</th><th>Instructor</th><th>Book</th><th>Book Included</th>
    </tr>
     </thead>
     <g:each in="${familyInstance?.students}" var="studentInstance">
     <g:each in="${studentInstance?.classes}" var="classInstance">
      <tr>
        <td>${studentInstance}</td>
        <td>${classInstance.course?.name}</td>
        <td>${classInstance.course?.startTime}</td>
        <td>${classInstance.course?.endTime}</td>
        <td>${classInstance.course?.teacher}</td>
        <td class="show"><a href="#" title="Book Detail" rel="${request.contextPath}/book/show/${classInstance.course?.book?.id}">${classInstance.course?.book}</a></td>
        <td>${classInstance.bookIncluded? "Yes":"No"}</td>
      </tr>
    </g:each>
     </g:each>
  </table>
</div>

<script type="text/javascript">
  $(function(){
      setupAdminList({controller:'classRegister', action:'showRegisteredClass'});
  });
</script>